from django.db import models


# Create your models here.

class Book(models.Model):
    uid = models.CharField(max_length=255, primary_key=True, verbose_name='ISBN')
    name = models.CharField(max_length=255, verbose_name='Name')
    publisher = models.CharField(max_length=255, verbose_name='Publisher')
    issue_date = models.CharField(verbose_name='Issue date')
    pages = models.IntegerField(verbose_name='Pages')

    author_intro = models.TextField(verbose_name='Author Introduction')
    contents = models.TextField(verbose_name="Contents")
    price = models.CharField(max_length=255, verbose_name='Price')
    agenda = models.TextField(verbose_name='Agender')
    pkg = models.CharField(max_length=100, verbose_name='Package')

    image = models.CharField(max_length=255, verbose_name='Small Image')
    authors = models.CharField(max_length=255, verbose_name="Authors")
    translators = models.CharField(max_length=255, verbose_name='Translators')
    origin_name = models.CharField(max_length=255, verbose_name='Origin Name')
    title = models.CharField(max_length=255, verbose_name='Title')
    series = models.CharField(max_length=255, verbose_name='Series')
    producer = models.CharField(max_length=255, verbose_name='Producer')

    def __str__(self):
        return self.name

    class Meta:
        db_table = 'book'
        verbose_name = u'书'
